package com.team.sns.listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import com.team.sns.entities.User;
import com.team.sns.services.impl.UserServiceBean;
/**
 * 监听用户权限
 * @author lyh
 * @version 1.0
 */
public class PermissionListener implements HttpSessionListener{

	public void sessionCreated(HttpSessionEvent arg0) {
		
	}

	public void sessionDestroyed(HttpSessionEvent arg0) {
		User user = (User)arg0.getSession().getAttribute("user");
		
		UserServiceBean.PERMISSIONMAP.remove(user.getId());
	}

}
